package com.example.reflection.entity;

import com.example.reflection.annotation.MyAnnotation;

/**
 * @author readpage
 * @create 2022-10-21 14:41
 */
@MyAnnotation(value = "hi")
public class User extends Creature<String> implements Comparable<String>, MyInterface {
    private static final long serialVersionUID = -2295116525231138505L;

    private String name;
    int age;
    public int id;

    public User() {

    }

    @MyAnnotation(value = "abc")
    private User(String name) {
        this.name = name;
    }

    User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @MyAnnotation
    private String show(String name) {
        System.out.println("hello " + name);
        return name;
    }

    public String display(String interests, int age) throws NullPointerException, ClassCastException {
        return interests + age;
    }

    @Override
    public int compareTo(String o) {
        return 0;
    }

    private static void showDesc() {
        System.out.println("hello world!");
    }

    @Override
    public void info() {
        System.out.println("我是一个人");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", id=" + id +
                '}';
    }
}
